import { effectKey, quality, EffectClassType, PassiveTriggerType, SkillType, TargetType, ConditionType, ConditionOperator, LogType } from "../../../../../shared/face/enums"
import { _Skill } from "../../../types"

/**
 * 高级被动技能示例 - 展示配置化触发条件的各种用法
 */
let data: _Skill[] = []

// 示例1: 生命值低于30%时触发
data.push({
    id: 'P001',
    name: '绝境反击',
    classType: EffectClassType.攻击型,
    quality: quality.SR,
    desc: '生命值低于30%时，攻击力提升50%',
    data: [{
        attKey: '物理攻击',
        attRange: 1.5
    }],
    effect: [effectKey.伤害类_普通攻击],
    cooldown: 0,
    type: SkillType.被动技能,
    range: [1],
    targetType: [TargetType.敌方],
    triggerType: [PassiveTriggerType.回合结束时],
    triggerConditionConfig: {
      groups: [{
        conditions: [{
          type: ConditionType.生命值百分比,
          operator: ConditionOperator.小于,
          value: 30
        }],
        logic: 'AND'
      }],
      logic: 'AND'
    }
})

// 第3回合后，每回合有30%概率触发
data.push({
    id: 'P002',
    name: '幸运一击',
    classType: EffectClassType.攻击型,
    quality: quality.SR,
    desc: '第3回合后，每回合有30%概率造成双倍伤害',
    data: [{
        attKey: '物理攻击',
        attRange: 2
    }],
    effect: [effectKey.伤害类_普通攻击],
    cooldown: 0,
    type: SkillType.被动技能,
    range: [1],
    targetType: [TargetType.敌方],
    triggerType: [PassiveTriggerType.回合结束时],
    triggerConditionConfig: {
      groups: [{
        conditions: [
          {
            type: ConditionType.回合数,
            operator: ConditionOperator.大于等于,
            value: 3
          },
          {
            type: ConditionType.随机概率,
            value: 0.3
          }
        ],
        logic: 'AND'
      }],
      logic: 'AND'
    }
})

// 敌方数量大于等于2时触发
data.push({
    id: 'P003',
    name: '群体威慑',
    classType: EffectClassType.防御型,
    quality: quality.SR,
    desc: '敌方数量大于等于2时，防御力提升30%',
    data: [{
        attKey: '物理防御',
        attRange: 1.3
    }],
    effect: [effectKey.辅助类_生命回复],
    cooldown: 0,
    type: SkillType.被动技能,
    range: [1],
    targetType: [TargetType.自己],
    triggerType: [PassiveTriggerType.回合结束时],
    triggerConditionConfig: {
      groups: [{
        conditions: [{
          type: ConditionType.目标数量,
          operator: ConditionOperator.大于等于,
          value: 2,
          target: 'enemy'
        }],
        logic: 'AND'
      }],
      logic: 'AND'
    }
})

// 复杂条件组合 - 生命值低于50%且魔法攻击大于100时触发
data.push({
    id: 'P004',
    name: '魔力爆发',
    classType: EffectClassType.攻击型,
    quality: quality.SSR,
    desc: '生命值低于50%且魔法攻击大于100时，造成魔法攻击力200%的伤害',
    data: [{
        attKey: '魔法攻击',
        attRange: 2
    }],
    effect: [effectKey.伤害类_魔法伤害],
    cooldown: 0,
    type: SkillType.被动技能,
    range: [1],
    targetType: [TargetType.敌方],
    triggerType: [PassiveTriggerType.回合结束时],
    triggerConditionConfig: {
      groups: [{
        conditions: [
          {
            type: ConditionType.生命值百分比,
            operator: ConditionOperator.小于,
            value: 50
          },
          {
            type: ConditionType.属性值,
            operator: ConditionOperator.大于,
            value: 100,
            attribute: '魔法攻击'
          }
        ],
        logic: 'AND'
      }],
      logic: 'AND'
    }
})

// 示例5: 多条件组 - 生命值低于20% 或 敌方数量为1时触发
data.push({
    id: 'P005',
    name: '背水一战',
    classType: EffectClassType.攻击型,
    quality: quality.SR,
    desc: '生命值低于20%或敌方只剩1人时，攻击力提升100%',
    data: [{
        attKey: '物理攻击',
        attRange: 2000
    }],
    effect: [effectKey.伤害类_普通攻击],
    cooldown: 0,
    type: SkillType.被动技能,
    range: [1],
    targetType: [TargetType.敌方],
    triggerType: [PassiveTriggerType.回合结束时],
    triggerConditionConfig: {
      groups: [
        {
          conditions: [{
            type: ConditionType.生命值百分比,
            operator: ConditionOperator.小于,
            value: 20
          }],
          logic: 'AND'
        },
        {
          conditions: [{
            type: ConditionType.目标数量,
            operator: ConditionOperator.等于,
            value: 1,
            target: 'enemy'
          }],
          logic: 'AND'
        }
      ],
      logic: 'OR'
    }
})

export default data; 